﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using ylyfDataConfigurations;

namespace ylyfDataTest
{
    /// <summary>
    /// Datareader 的摘要说明
    /// </summary>
    public class Datareader : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            HiSqlDataBase db=new HiSqlDataBase(ConfigurationManager.ConnectionStrings["DbConnection"].ToString());
            var command=db.CreateSqlStringCommand("UPDATE tb1 SET tlbit=0 WHERE int=2");
            using (var tran=db.StartTransaction())
            {
                tran.ExecuteNonQuery(command);
                tran.Rollback();
            }
            var command1 = db.CreateSqlStringCommand("UPDATE tb1 SET tlbit=0 WHERE int=3");
            command1.ExecuteNonQuery();
            context.Response.Write("hello");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}